package com.tancire.net.service.impl;

import java.util.List;
import javax.annotation.Resource;

import com.tancire.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.tancire.net.mapper.OrderLogMapper;
import com.tancire.net.domain.OrderLog;
import com.tancire.net.service.IOrderLogService;

/**
 * 订单日志Service业务层处理
 *
 * @author chenchao
 * @date 2023-11-30
 */
@Service
public class OrderLogServiceImpl implements IOrderLogService {
    @Resource
    private OrderLogMapper orderLogMapper;

    /**
     * 查询订单日志
     *
     * @param id 订单日志主键
     * @return 订单日志
     */
    @Override
    public OrderLog selectOrderLogById(Long id) {
        return orderLogMapper.selectOrderLogById(id);
    }

    /**
     * 查询订单日志列表
     *
     * @param orderLog 订单日志
     * @return 订单日志
     */
    @Override
    public List<OrderLog> selectOrderLogList(OrderLog orderLog) {
        return orderLogMapper.selectOrderLogList(orderLog);
    }

    /**
     * 新增订单日志
     *
     * @param orderLog 订单日志
     * @return 结果
     */
    @Override
    public int insertOrderLog(OrderLog orderLog) {
        orderLog.setCreateTime(DateUtils.getNowDate());
        return orderLogMapper.insertOrderLog(orderLog);
    }

    /**
     * 修改订单日志
     *
     * @param orderLog 订单日志
     * @return 结果
     */
    @Override
    public int updateOrderLog(OrderLog orderLog) {
        return orderLogMapper.updateOrderLog(orderLog);
    }

    /**
     * 批量删除订单日志
     *
     * @param ids 需要删除的订单日志主键
     * @return 结果
     */
    @Override
    public int deleteOrderLogByIds(Long[] ids) {
        return orderLogMapper.deleteOrderLogByIds(ids);
    }

    /**
     * 删除订单日志信息
     *
     * @param id 订单日志主键
     * @return 结果
     */
    @Override
    public int deleteOrderLogById(Long id) {
        return orderLogMapper.deleteOrderLogById(id);
    }
}
